<?php 
include TMPL_PATH.'public/header.phtml';
?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='javascript:;' class="on"><em>分类目录管理</em></a><span>|</span>
        <a href='javascript:add();' ><em>添加分类目录</em></a></div>
</div>
<div class="pad_10">
<div class="explain-col">
温馨提示：分类目录功能是为了后台增加分类设计，可自行增加后台没有的分类，增加的分类将在<font color="red">产品添加页</font>显示
</div>
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
            <th width="100">ID</th>
            <th align='left'>分类目录名称</th>
            <th align='center' width="100">分类目录别名</th>
						<th >管理操作</th>
            </tr>
        </thead>
     <tbody>
   <?php 
   	if(isset($vocabularyList) && $vocabularyList):
   		foreach ($vocabularyList as $v):
   ?>
			<tr>
					<td align='center'><?php echo $v['id']?></td>
					<td><?php echo $v['name']?></td>
					<td align='center'><?php echo $v['name_cn']?></td>
					<td align='center' > 
					<?php if($v['id']<6){?>
						<font color="#cccccc">添加子类</font>&nbsp;&nbsp;|&nbsp;&nbsp;
						<a href="javascript:edit(<?php echo $v['id']?>, '<?php echo $v['name']?>')">修改</a>&nbsp;&nbsp;|&nbsp;&nbsp;
						<font color="#cccccc">删除</font>
					<?php }else{?>
					<a href="<?php echo U('category/index', 'vid='.$v['id']);?>">子类列表</a>&nbsp;&nbsp;|&nbsp;&nbsp;
					<a href="<?php echo U('category/add', 'vid='.$v['id']);?>">添加子类</a>&nbsp;&nbsp;|&nbsp;&nbsp;
					<a href="javascript:edit(<?php echo $v['id']?>, '<?php echo $v['name']?>')">修改</a>&nbsp;&nbsp;|&nbsp;&nbsp;
					<a href="javascript:confirmurl('<?php echo U('vocabulary/delete', 'vid='.$v['id']);?>','确认要删除 『<?php echo $v['name']?>』 吗？')">删除</a>
					<?php }?>
					</td>
				</tr>
	<?php 
		endforeach;
		endif;
	?>
   </tbody>
    </table>
</div>
</div>
</body>
</html>
<script type="text/javascript">
<!--
	function edit(vid, name) {
		window.top.art.dialog({title:'修改--'+name, id:'edit', iframe:'<?php echo U('vocabulary/edit')?>&vid='+vid ,width:'500px',height:'200px'}, 	function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
		var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
	}
function add() {
	window.top.art.dialog({title:'添加--分类目录', id:'add', iframe:'<?php echo U('vocabulary/add')?>' ,width:'500px',height:'200px'}, 	function(){var d = window.top.art.dialog({id:'add'}).data.iframe;
	var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'add'}).close()});
}
//-->
</script>